package com.netty.hanler.fram;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufAllocator;
import io.netty.handler.codec.DelimiterBasedFrameDecoder;

import java.nio.charset.StandardCharsets;

/**
 * @author xl-9527
 * @since 2024/6/10
 **/
public class FrameBaseLine extends DelimiterBasedFrameDecoder {

    private static final ByteBuf delimiter = ByteBufAllocator.DEFAULT.buffer();

    static {
        delimiter.writeBytes("\r\n".getBytes(StandardCharsets.UTF_8));
    }

    public FrameBaseLine() {
        this(delimiter);
    }

    public FrameBaseLine(ByteBuf delimiter) {
        super(1024, delimiter);
    }
}
